<?php
/**************************************************************************
 * Naanal PHP Framework, Simple, Efficient and Developer Friendly
 * Ver 3.0, Copyright (C) <2010>  <Tamil Amuthan. R>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ************************************************************************/
class ClsNaanalmodcontr
{
    private $objConfig=null;
    private $module="";
    public function __construct($module,$objConfig) {
        $this->objConfig=$objConfig;
        $this->module=$module;
    }
    public function render()
    {
        $arrMethod=array();
        
        $arrAction=$this->objConfig->getActionNames();
        foreach($arrAction as $action)
        {
            $arrMethod[$action]="
    public function {$action}()
    {
        /**
        you code here
        **/
        
        ///return all the variables(key as name of the variable and value as the data in the variable) needed in the template file({$action}.php)
        return array();
    }";
        }
        
        $methods=implode("",$arrMethod);
        $class="Cls".ucfirst($this->module);
        $controller='<?php
'."class {$class} extends ClsNaanalController
{
    public function __construct()
    {
        parent::__construct();
    }
    {$methods}
}".'
?>';
        return $controller;
    }
}
?>